enum AppThemeMode {
  light(name: "浅色模式", value: 0),
  dark(name: "深色模式", value: 1),
  ;

  final String name;
  final int value;
  const AppThemeMode({required this.name, required this.value});

  //通过值生成枚举
  static AppThemeMode of(int? value) {
    switch (value) {
      case 0:
        return AppThemeMode.light;
      default:
        return AppThemeMode.dark;
    }
  }
}